package de.wieger.smalltalk.eclipse.core;

import org.eclipse.dltk.ui.text.ScriptTextTools;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;



/**
 * The activator class controls the plug-in life cycle
 */
public class SmalltalkPlugin extends AbstractUIPlugin {
    //--------------------------------------------------------------------------  
    // constants
    //--------------------------------------------------------------------------

	// The plug-in ID
	public static final String PLUGIN_ID = "de.wieger.smalltalk.eclipse";

	
	
	//--------------------------------------------------------------------------  
    // class variables
    //--------------------------------------------------------------------------

	// The shared instance
	private static SmalltalkPlugin sfPlugin;

	

	//--------------------------------------------------------------------------  
    // instance variables
    //--------------------------------------------------------------------------

    private ScriptTextTools fTextTools;
	
	
	
	//--------------------------------------------------------------------------  
    // AbstractUIPlugin methods (implementation)
    //--------------------------------------------------------------------------

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		sfPlugin = this;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		sfPlugin = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static SmalltalkPlugin getDefault() {
		return sfPlugin;
	}



    public ScriptTextTools getTextTools() {
        if (fTextTools == null) {
            fTextTools = new SmalltalkTextTools();
        }
        return fTextTools;
    }
}
